//
// Created by hsj on 2024-1-12.
// 标准IO，有缓冲
#include <stdio.h>
#define BUF_SIZE 3 //用最短数组长度构成
int main(int argc, char *argv[]) {
    FILE *fp1; //保存在fp1中的是FILE结构体指针
    FILE *fp2; //保存在fp2中的是FILE结构体指针
    char buf[BUF_SIZE];
    fp1 = fopen("news.txt", "r");
    fp2 = fopen("cpy_std_io.txt", "w");
    while (fgets(buf, BUF_SIZE, fp1)!=NULL)
        fputs(buf, fp2);

    fclose(fp1);
    fclose(fp2);
    return 0;
}
